import ajax from '@/utils/request'
import { concatUrl } from '@/utils'

export function getDefaultList(data, fields: string | object = { fields: '*' }) {
  return ajax({
    url: concatUrl(`/v1/maintainHelper/maintain-helper/index`, fields),
    data,
    method: 'GET'
  })
}

export function getCouponList(data, fields: string | object = { fields: '*' }) {
  return ajax({
    url: concatUrl(`/v1/maintainHelper/maintain-helper/project-coupon`, fields),
    data,
    method: 'GET'
  })
}

export function receiveCoupon(data, fields: string | object = { fields: '*' }) {
  return ajax({
    url: concatUrl(`/v1/maintainHelper/maintain-helper/project-coupon-receive`, fields),
    data,
    method: 'POST'
  })
}

export function getDiscountTip(data = {}, fields: string | object = { fields: '*' }) {
  return ajax({
    url: concatUrl(`/v1/maintainHelper/maintain-helper/discount`, fields),
    data,
    method: 'GET'
  })
}

export function getSpec(data = {}, fields: string | object = { fields: '*' }) {
  return ajax({
    url: concatUrl(`/v1/maintainHelper/maintain-helper/project-item-goods`, fields),
    data,
    method: 'GET'
  })
}

export function getItemUse(data = {}, fields: string | object = { fields: '*' }) {
  return ajax({
    url: concatUrl(`/v1/maintainHelper/maintain-helper/project-item-goods-use`, fields),
    data,
    method: 'GET'
  })
}

export function getLaborFee(data = {}, fields: string | object = { fields: '*' }) {
  return ajax({
    url: concatUrl(`/v1/maintainHelper/maintain-helper/labor-fee`, fields),
    data,
    method: 'POST'
  })
}